package cn.bdqn.comment;

import cn.bdqn.petadoptions.comment.Result;
import cn.bdqn.petadoptions.comment.Status;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

/**
 * @ProjectName: Petadoptions
 * @Package: cn.bdqn.MyBatisPlus.comment
 * @ClassName: Result
 * @Author: haha  86130
 * @Description: Result使用方法
 * @Date: 2021/8/25 10:45
 * @Version: 1.0
 */
public class Resultxx {


    @Test
    public void ss(){
        List<User> arrayList = new ArrayList<>();
        User hh = new User(1, "hh");
        User gg = new User(1, "gg");
        arrayList.add(hh);
        arrayList.add(gg);

        Result<List<User>> cuowuResult = Result.buildResult(Status.BAD_REQUEST);
        Result<List<User>> listResult = Result.buildResult(Status.OK, arrayList);

        System.out.println("状态码:"+cuowuResult.getStatus()+"\n状态信息："+cuowuResult.getMessage()+"\n数据对象:"+cuowuResult.getData());
        System.out.println("状态码:"+listResult.getStatus()+"\n状态信息："+listResult.getMessage()+"\n数据对象:"+listResult.getData());
    }

}
